package qldc.pm.tiensu.service.messaging;

import com.liferay.portal.kernel.messaging.BaseMessageListener;
import com.liferay.portal.kernel.messaging.Message;

import qldc.pm.tiensu.service.BienBanBanGiaoHoSoLocalServiceUtil;
import qldc.pm.tiensu.service.ClpSerializer;
import qldc.pm.tiensu.service.CongViecBanGiaoLocalServiceUtil;
import qldc.pm.tiensu.service.DoiTuongTienSuLocalServiceUtil;
import qldc.pm.tiensu.service.KetQuaTrichLucLocalServiceUtil;
import qldc.pm.tiensu.service.LichSuXoaAnTichLocalServiceUtil;
import qldc.pm.tiensu.service.PhieuThongTinVeNguoiCoTienSuLocalServiceUtil;
import qldc.pm.tiensu.service.PhucHoiTienSuLocalServiceUtil;
import qldc.pm.tiensu.service.SaoLuuTienSuLocalServiceUtil;
import qldc.pm.tiensu.service.TEMP_DoiTuongTienSuLocalServiceUtil;
import qldc.pm.tiensu.service.TEMP_PhieuThongTinVeNguoiCoTienSuLocalServiceUtil;
import qldc.pm.tiensu.service.TEMP_TienSuLocalServiceUtil;
import qldc.pm.tiensu.service.TangThuLocalServiceUtil;
import qldc.pm.tiensu.service.TienSuLocalServiceUtil;
import qldc.pm.tiensu.service.YeuCauTrichLucLocalServiceUtil;


public class ClpMessageListener extends BaseMessageListener {
    public static String getServletContextName() {
        return ClpSerializer.getServletContextName();
    }

    @Override
    protected void doReceive(Message message) throws Exception {
        String command = message.getString("command");
        String servletContextName = message.getString("servletContextName");

        if (command.equals("undeploy") &&
                servletContextName.equals(getServletContextName())) {
            BienBanBanGiaoHoSoLocalServiceUtil.clearService();

            CongViecBanGiaoLocalServiceUtil.clearService();

            DoiTuongTienSuLocalServiceUtil.clearService();

            KetQuaTrichLucLocalServiceUtil.clearService();

            LichSuXoaAnTichLocalServiceUtil.clearService();

            PhieuThongTinVeNguoiCoTienSuLocalServiceUtil.clearService();

            PhucHoiTienSuLocalServiceUtil.clearService();

            SaoLuuTienSuLocalServiceUtil.clearService();

            TangThuLocalServiceUtil.clearService();

            TEMP_DoiTuongTienSuLocalServiceUtil.clearService();

            TEMP_PhieuThongTinVeNguoiCoTienSuLocalServiceUtil.clearService();

            TEMP_TienSuLocalServiceUtil.clearService();

            TienSuLocalServiceUtil.clearService();

            YeuCauTrichLucLocalServiceUtil.clearService();
        }
    }
}
